package com.tx.redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Pipeline;

/**
 * @author ：tx
 * @version:
 */
public class PipelineDemo {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("212.64.48.45",6379);
        jedis.auth("123456");

        long begin = System.currentTimeMillis();
        Pipeline pipeline = jedis.pipelined();
        for (int i = 10000; i < 200000; i++) {
            pipeline.set("k" + i, "v" + i);
        }

        pipeline.sync();
        long end = System.currentTimeMillis();
        System.out.println("花费的时间：" + (end - begin)/(1000*1000));
        jedis.close();
    }
}
